<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>表单验证规则明细</title>
        <#include "/pubHeadStyle.html">
        <script src="${ctx}/extends/jquery.min.js" type="text/javascript"></script>
        <link rel="stylesheet" href="${ctx}/css/form.css">
    </head>
    <body>
        <form class="layui-form" style="background: #fff;height: 100%;">
            <div class="layui-fluid" style="height:380px;overflow: auto">
                <div class="layui-form-item">
                    <label class="layui-form-label">规则名</label>
                    <div class="layui-input-inline" style="width: 160px">
                        <input type="text" id="ruleName" name="ruleName" autocomplete="off" style="width: 160px"
                               class="layui-input" readonly>
                    </div>
                    <label class="layui-form-label">别名</label>
                    <div class="layui-input-inline" style="width: 160px">
                        <input type="text" id="alias" name="alias" style="width: 160px" autocomplete="off"
                               class="layui-input" readonly>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">规则</label>
                    <div class="layui-input-block" style="width: 440px;">
                        <input type="text" id="rule" name="rule" autocomplete="off" class="layui-input" readonly>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label" style="width: 85px;margin-left: -5px;">错误提示信息</label>
                    <div class="layui-input-block" style="width: 440px;">
                        <input type="text" id="tipInfo" name="tipInfo" autocomplete="off" class="layui-input" readonly>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">描述</label>
                    <div class="layui-input-block" style="width: 440px;">
                        <input type="text" id="memo" name="memo" autocomplete="off" class="layui-input" readonly>
                    </div>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="layui-btn-container" style="position: absolute;left: 47%;bottom: 0;">
                <button class="layui-btn layui-btn-danger" id="return">关闭</button>
            </div>
        </form>
        <script>
            layui.config({
                base: serverPath.formPath + staticPath.formPath //静态资源所在路径
            }).extend({
                index: 'index' //主入口模块
            }).use(['index', 'form', 'jquery'], function () {
                var form = layui.form;
                var layer = layui.layer;
                var $ = layui.$;
                var setter = layui.setter;

                var ruleId = '${ruleId}';
                //获取数据
                $.ajax({
                    url: serverPath.formPath + setter.formLinkPath + "formRule/detail",
                    data: {"ruleId": ruleId},
                    dataType: 'json',
                    contextType: 'json',
                    success: function (data) {
                        var resultData = data.data;
                        $("#ruleName").val(resultData.name);
                        $("#alias").val(resultData.alias);
                        $("#rule").val(resultData.rule);
                        $("#tipInfo").val(resultData.tipInfo);
                        $("#memo").val(resultData.memo);
                        form.render();
                    },
                    error: function () {
                        layer.msg("cuole ");
                    }
                });

            });
            $("#return").click(function () {
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            });
        </script>
    </body>
</html>